


import org.authsum.stitches.Helper

class ContentControllerTests extends GroovyTestCase {
	
	
	
	def helper

    def stitchesService
    
    
    void testSaveContent() {
    	//need to create contentdef
    
    	    	
		def controller = new ContentController()
		controller.stitchesService  = stitchesService
		Long contentDefId = helper.getContentDefId(name:"testSaveContent")

		
		
		
		controller.request.parameters = ['contentDefId':contentDefId.toString(),'name':"content",'fileName':"test.html"]
    		
    	
    	
		controller.saveContent()
    	
    	
    	
    }
	
	
    void testIndex() {
    	//need to create contentdef
    
    	    	
		def controller = new ContentController()
		
		controller.stitchesService  = stitchesService

		Long contentDefId = helper.getContentDefId(name:"testIndex")
		
		
		//won't have any to return, but still should work
		controller.request.parameters = ['id':contentDefId.toString()]
    		
    	
    	
		controller.index()
  
    	
    }
    
    
}
